#include "httplib.h"

#define SERVER_IP "8.134.166.109"
#define SERVER_PORT 9090
int main()
{
    httplib::Client client(SERVER_IP, SERVER_PORT); // 实例化client对象，用于搭建客户端

    httplib::MultipartFormData item;//多区域文件上传，定义一个区域文件信息的结构体
    item.name = "file";
    item.filename = "hello.txt";
    item.content = "Hello World"; // 上传文件时，这里给的就是文件内容
    item.content_type = "text/plain";
    httplib::MultipartFormDataItems items;
    items.push_back(item);

    auto res = client.Post("/multipart", items);//提交的数据就是items
    std::cout << res->status << std::endl;//响应状态码
    std::cout << res->body << std::endl;//响应正文

    return 0;
}